<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich">

<ui:composition template="../templates/simpleLayout.xhtml">

	<ui:define name="heading">
		<center>
			<h1>#{msg.accesoRestringido}</h1>
		</center>
	</ui:define>

	<ui:define name="content">
		<center>
			<h:panelGrid width="300px" columns="3">
				<rich:panel>
					<f:facet name="header">
						<h:outputText value="#{msg.loginPanel}" />
					</f:facet>
					<h:form id="loginForm">
						<h:panelGrid id="pidiomas" width="100%" columns="3"
							style="align:right">
							<h:commandButton id="ides" alt="ES" image="/images/esp.gif"
								width="30" height="40"
								action="#{loginBean.changeLanguage('es')}" immediate="true" />
							<h:commandButton id="iden" alt="EN" image="/images/uk.png"
								width="30px" action="#{loginBean.changeLanguage('en')}"
								immediate="true" />
							<h:commandButton id="idfr" alt="FR" image="/images/fr.gif"
								width="30px" action="#{loginBean.changeLanguage('fr')}"
								immediate="true" />
						</h:panelGrid>
						<p />
						<h:panelGrid width="100%" columns="3"
							columnClasses="width: 200px; width: 100px;">

							<h:panelGrid width="65px">
								<h:outputText value="#{msg.usuario}" />
							</h:panelGrid>
							<h:panelGrid width="165px">
								<h:inputText id="username" value="#{loginBean.usuario.username}"
									required="true" validatorMessage="#{msg.validateUsername}"
									requiredMessage="#{msg.requiredUsername}" size="25">
									<f:validateLength minimum="2" />
								</h:inputText>

							</h:panelGrid>
							<h:panelGrid width="200px">
								<rich:message for="username" ajaxRendered="true" />
							</h:panelGrid>

							<h:panelGrid width="75px">
								<h:outputText value="#{msg.clave}" />
							</h:panelGrid>
							<h:panelGrid width="165px">
								<h:inputSecret id="clave" value="#{loginBean.usuario.password}"
									size="25" required="true"
									requiredMessage="#{msg.requiredPassword}" />
								
							</h:panelGrid>
							<h:panelGrid width="200px">
								<rich:message for="clave" ajaxRendered="true" />
							</h:panelGrid>
						</h:panelGrid>
						<p />
						<h:panelGrid width="100%" columns="1"
							styleClass="text-align:center">
							<h:commandButton id="loginButton" value="#{msg.entrar}"
								action="#{loginBean.submit}"
								actionListener="#{loginBean.onLogin}"
								style="width: 70px; height: 25px; " />
							<rich:messages for="loginButton " ajaxRendered="true" />
						</h:panelGrid>
						<p />
					</h:form>
				</rich:panel>
			</h:panelGrid>
		</center>
	</ui:define>
</ui:composition>
</html>